/**
 *  @file sinusoidalController.h
 *
 *  @date 22-dec-2009
 *  @author Ives van der Flaas
 */

#ifndef SINUSOIDALCONTROLLER_H_
#define SINUSOIDALCONTROLLER_H_

#include "controller.h"

namespace si
{
/**
 * A controller that moves the object in a sinusoidal manner from left to right. The amount this controller
 * moves to the left and right can be determined, just like its vertical pace.
 */
class SinusoidalController: public si::Controller
{
public:
	/**
	 * Ctor
	 * @param startPos Starting position for this controller
	 * @param vSpeed Vertical speed (negative if going down) of the controller
	 * @param sweepWidth Total width (= go left + go right) the ship moves
	 * @param size Virtual size of the controller
	 * @return
	 */
	SinusoidalController(const Vector2 startPos, const double vSpeed, const double sweepWidth, Vector2 size);
	virtual ~SinusoidalController();
	virtual void update(const double time);

private:
	double fVerticalSpeed;
	double fSweepWidth;
	double fTotalTime;
	double fStartXpos;

};

}

#endif /* SINUSOIDALCONTROLLER_H_ */
